#pragma once

#include <d3d10.h>
#include "EnginePointer.h"
#include "RenderComponent.h"
#include "ICameraComponent.h"

class ModelRenderer
{
public:
	ModelRenderer(void);
	~ModelRenderer(void);

    HRESULT LoadGraphicsContent(EnginePointer<ID3D10Device>& pDevice, EnginePointer<ID3D10EffectPool>& pCommonPool);
    void UnloadGraphicsContent();
    HRESULT Render(EnginePointer<Model>& model, list<EnginePointer<RenderComponent>> components);
private:
	EnginePointer<ID3D10Device> pDevice;
	ID3D10Effect* pEffect;
	ID3D10InputLayout* pVertexLayout;
	ID3D10EffectTechnique* pTechnique;
	ID3D10Buffer* pInstanceBuffer;
	ID3D10EffectShaderResourceVariable* pDiffuseVariable;
	ID3D10EffectShaderResourceVariable* pNormalVariable;
	ID3D10EffectShaderResourceVariable* pSpecularVariable;

	HMODULE contentModule;

	static DWORD maxNumOfInstances;
};
